﻿$(document).ready(function() {
    JSUtility.url = '../Handler/AjaxHandle.ashx';
    JSUtility.param = { AssemblyName: "OA.Bll.Personnel", ClassName: "OA.Bll.Personnel.PatentPresenter", Method: "Search", Options: {} };
    top.autoResize({ dataGrid: '#Grid', callback: InitPatentlist, par: {}, method: 'Paged' });
    $('#btnSubmit,#btnCancel').linkbutton();
    JSUtility.window_edit_title = "专利信息";
    JSUtility.window_edit_form = $("#PatentWin").find("form");
    JSUtility.window_edit = $("#PatentWin");
    $("#btnAdd").click(function() {
        JSUtility.add();
    });
    $("#btnDel").click(JSUtility.del);
    $("#btnEdit").bind("click", JSUtility.update);
    $("#btnSubmit").click(function() {
        JSUtility.param.Options["EmployeeID"] = $("#EmployeeID").combotree('getValue');
        JSUtility.save();
    });
    $('#btnCancel').click(JSUtility.close);
});

function InitPatentlist(op, method, size) {
    var p = JSUtility.param;
    JSUtility.grid = $('#Grid').datagrid({
        width: size.width,
        height: size.height,
        pageSize: Math.round(size.height / 25),
        pageList: [Math.round(size.height / 25)],
        striped: true,
        queryParams: { "json": $.toJSON(p) },
        url: JSUtility.url,
        singleselect: true
    });
}
